<?php
/* @var $this AgendaController */
/* @var $model Agenda */
/* @var $form CActiveForm */
//app()->clientScript->registerScriptFile(bu().'/plugins/jquery-1.8.3.min.js');
$request = Yii::app()->request;
if ($request->enableCsrfValidation) {
    echo CHtml::metaTag($request->getCsrfToken(), 'csrf-token');
    echo CHtml::metaTag($request->csrfTokenName, 'csrf-param');
}
?>

<div class="form">
    <?php $form = $this->beginWidget('CActiveForm', array('id' => 'agenda-form', 'enableAjaxValidation' => false,)); ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <div>&nbsp;</div>
    <?//php echo $form->errorSummary($model); ?>



    <table border="0" cellpadding="0" cellspacing="0" id="id-form">
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('nama') . '*'; ?></th>
            <td class="idform">
                <?php echo $form->textField($model, 'nama',
                array('size' => 60, 'maxlength' => 250, 'class' => 'inp-formpanjang')); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('nama')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'nama', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('name_'); ?></th>
            <td class="idform">
                <?php echo $form->textField($model, 'name_',
                array('size' => 60, 'maxlength' => 250, 'class' => 'inp-formpanjang')); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('name_')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'name_', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('lokasi') . '*'; ?></th>
            <td class="idform">
                <?php echo $form->textField($model, 'lokasi',
                array('size' => 60, 'maxlength' => 250, 'class' => 'inp-form')); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('lokasi')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'lokasi', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('tgl_mulai') . '*'; ?></th>
            <td class="idform">
                <?php // echo $form->textField($model,'tgl_mulai',array('size'=>60,'maxlength'=>250,'class' => 'inp-form'));
                $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                    'model' => $model,
                    'attribute' => 'tgl_mulai',
                    // additional javascript options for the date picker plugin
                    'options' => array(
                        'showAnim' => 'fold',
                        'changeMonth' => true,
                        'changeYear' => true,
                        'gotoCurrent' => true,
                        'dateFormat' => "dd-mm-yy"),
                    'htmlOptions' => array(
                        'style' => 'height:30px;',
                        'class' => 'inp-form ',
                        'size' => 60,
                        'maxlength' => 250,
                        'readonly' => 'readonly'),));
                ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('tgl_mulai')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'tgl_mulai', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('tgl_selesai') . '*'; ?></th>
            <td class="idform">
                <?php //echo $form->textField($model,'tgl_selesai',array('size'=>60,'maxlength'=>250,'class' => 'inp-form'));

                $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                    'model' => $model,
                    'attribute' => 'tgl_selesai',
                    // additional javascript options for the date picker plugin
                    'options' => array(
                        'showAnim' => 'fold',
                        'changeMonth' => true,
                        'changeYear' => true,
                        'gotoCurrent' => true,
                        'dateFormat' => "dd-mm-yy"),
                    'htmlOptions' => array(
                        'style' => 'height:30px;',
                        'class' => 'inp-form ',
                        'size' => 60,
                        'maxlength' => 250,
                        'readonly' => 'readonly'),));


                ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('tgl_selesai')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'tgl_selesai', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('keterangan') . '*'; ?></th>
            <td class="idform">
                <?php $this->widget('ext.tinymce.TinyMce', array(
                'model' => $model,
                'attribute' => 'keterangan',
                'fileManager' => array(
                    'class' => 'ext.elFinder.TinyMceElFinder',
                    'connectorRoute' => 'elfinder/connector',),
                'htmlOptions' => array('rows' => 6, 'cols' => 60,),
                //                    "config" => array(
//                        "height"=>"400px",
//                        "width"=>"100%",
//                        "filebrowserUploadUrl"=>url('agenda/upload',array('YII_CSRF_TOKEN'=>app()->request->csrfToken)),
//                    ),
            )); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('keterangan')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'keterangan', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('content'); ?></th>
            <td class="idform">
                <?php $this->widget('ext.tinymce.TinyMce', array(
                'model' => $model,
                'attribute' => 'content',
                'fileManager' => array(
                    'class' => 'ext.elFinder.TinyMceElFinder',
                    'connectorRoute' => 'elfinder/connector',),
                'htmlOptions' => array('rows' => 6, 'cols' => 60,),)); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('content')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'content', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th>&nbsp;</th>
            <td valign="top">
              <?php echo CHtml::submitButton($model->isNewRecord ? 'Buat' : 'Simpan',array('class'=>'form-submit')); ?>
            </td>
            <td class="idform"></td>
        </tr>
    </table>


    <?php $this->endWidget(); ?>
</div><!-- form -->